<template>
  <common-crud ref="sysUser" :crudOptionProps="crudOptionProps"></common-crud>
</template>

<script>
import commonCrud from "@/components/commonCrud/CommonCrud.vue"
import {baseUrl} from "../../../config/env";
import {isMobile, passWordLink} from "@/utils/validate"

export default {
  name: "sysUser",
  components: {commonCrud},
  data() {
    return {
      // 表配置
      crudOptionProps: {
        name: "sys/user",
        apiPrefix: '/system/sysUser',
        // 是否云原生
        // functionTarget: 'sysUser',
        permissionOption: {
          enable: true

        },
        tableOption: {
          column: [


            {
              label: "用户名",
              prop: "username",
              maxlength: 10,
              search: true,
              required: true,
              rules: [

                {min: 5, max: 10, message: '名称长度在3到10个字符', trigger: 'blur'}

              ]
            },


            {
              label: "密码",
              prop: "password",
              type: 'password',
              hide: true,
              search: false,
              required: true,
              rules: [

                {required: true, validator: passWordLink, trigger: 'change'}

              ]

            },


            {
              label: "姓名",
              prop: "name",
              search: false,
              required: true
            },


            {
              label: "手机号",
              prop: "phone",
              search: true,
              required: true,
              rules: [

                {required: true, validator: isMobile, trigger: 'change', message: '手机号格式不正确',}

              ]

            },
            {
              label: "角色",
              prop: "roleIds",
              type: 'select',
              required: true,
              remote: true,
              multiple: true,
              dicUrl: baseUrl + '/system/sysRole/choose/role',
              props: {
                label: 'roleName',
                value: 'id'
              },
            }


          ]
        },

      }

    }
  },
    created()
    {

    }
  ,
    computed()
    {

    }
  ,
    methods: {
    }
  }
</script>

<style scoped>

</style>
